
<div class="product-info">
<div class="info clearfix">
    <?php if ($thumb || $images) { ?>
    <div class="pic">
        <?php if ($thumb) { ?>
        <div class="big">
            
                <img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>"/>

        </div>
        <?php } ?>
        <div class="small clearfix">
            <?php 
            $imageCount = 0;
            if ($thumb) { $imageCount++;?>
            <a href="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>">
                <img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>"/>
            </a>
            <?php } ?>
            <?php 
            if ($images) {
                foreach ($images as $image) { 
                $imageCount++;
            ?>
            <a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" >
                <img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" />
            </a>
            <?php } } ?>
            <?php for($i=0;$i<4-$imageCount;$i++){ ?>
            <a href="#" class="noimage" >
                <img src="#" />
            </a>
            <?php } ?>
        </div>
    </div>
    <?php } ?>
    <div class="txt">
        <h3><?php echo $heading_title; ?></h3>
        <div class="desc">
            <?php echo $description; ?>
        </div>
        <ul class="para">
            <li><strong>价 格：</strong>
            <?php if ($price) { ?>
                <?php if (!$special) { ?>
                <span><?php echo $price; ?>元</span>
                <?php } else { ?>
                <span class="price-old"><?php echo $price; ?>元</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 优惠价： <span class="price-new special"><?php echo $special; ?></span>元
                <?php } ?>
            <?php } ?>
            </li>
            <li><strong>状 态：</strong><span> <?php echo $stock; ?></span></li>
            
            <?php foreach ($attribute_groups as $attribute_group) { ?>
                <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
                <li><strong><?php echo $attribute['name']; ?>：</strong><span> <?php echo $attribute['text']; ?></span></li>
                <?php } ?>
            <?php } ?>
            
        </ul>
        <div class="order">
            <table>
                <tr>
                    <td><div class="pri">我要买 </div></td>
                    <td>
                        <div class="num">
                            <ul class="select-qua">
                                <li class="lt"><a href="#" class="remove">-</a></li>
                                <li class="md"><input type="txt" class="ipt_num" value="<?php echo $minimum; ?>"/></li>
                                <li class="rt"><a href="#" class="add">+</a></li>
                                <li>&nbsp;份</li>
                            </ul>
                        </div>  
                    </td>
                    <td>
                        <a href="#" data-mid="<?php echo $product_id; ?>" data-price="<?php if(!$special){echo $price;}else{echo $special;} ?>" data-name="<?php echo $heading_title; ?>" class="btn-order" >订购/Order now</a>
                    </td>
                </tr>
                <tr>
                    <td> </td>
                    <td> </td>
                    <td>
                        <?php if ($products) { ?>
                        <?php foreach ($products as $product) { 
                                if($product['name'] == $heading_title.HALFSIZE_PREFIX){
                            ?>
                                <a href="#" data-mid="<?php echo $product['product_id']; ?>" data-price="<?php if(!$product['special']){echo $product['price'];}else{echo $product['special'];} ?>" data-name="<?php echo $product['name']; ?>"  class="btn-order half-size" >半份/Half were</a>
                            <?php } }  ?>
                        <?php } ?>
                    </td>
                </tr>
            </table>
            
        </div>
        
        <?php if ($discounts) { ?>
        <div class="discount">
            <?php foreach ($discounts as $discount) { ?>
            <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
            <?php } ?>
        </div>
        <?php } ?>
        <?php if ($options == 9) { ?>
            <?php foreach ($options as $option) { 
                if($option['name'] == "半份"){
                    foreach ($option['option_value'] as $option_value) { 
            ?>
                <div class="select-half"><input type="checkbox" value="<?php echo $option_value['product_option_value_id']; ?>" name="option[<?php echo $option['product_option_id']; ?>]"/> 半分</div>
            <?php } } } ?>
        <?php } ?>
        

    </div>
</div>
</div>